//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.print.options;

import java.awt.*;
import javax.swing.*;

public class GroupTotalPanel extends JPanel {

    public GroupTotalPanel() {
        grossPriceButton = null;
        sendingPriceButton = null;
        taxPriceButton = null;
        netPriceButton = null;
        partPaymentCheckBox = null;
        dueCheckBox = null;
        initialize();
    }

    private void initialize() {
        FlowLayout flowLayout5 = new FlowLayout();
        setLayout(flowLayout5);
        setSize(300, 160);
        setBorder(BorderFactory.createTitledBorder(null, "Totaux", 0, 0, new Font("Dialog", 1, 12), new Color(51, 51, 51)));
        flowLayout5.setHgap(2);
        flowLayout5.setVgap(2);
        add(getGrossPriceButton(), null);
        add(getSendingPriceButton(), null);
        add(getTaxPriceButton(), null);
        add(getNetPriceButton(), null);
        add(getPartPaymentCheckBox(), null);
        add(getDueCheckBox(), null);
    }

    private JButton getGrossPriceButton() {
        if (grossPriceButton == null) {
            grossPriceButton = new JButton();
            grossPriceButton.setPreferredSize(new Dimension(284, 20));
            grossPriceButton.setBorderPainted(false);
            grossPriceButton.setContentAreaFilled(false);
            grossPriceButton.setFocusPainted(false);
            grossPriceButton.setText("Total HT");
            grossPriceButton.setHorizontalAlignment(2);
        }
        return grossPriceButton;
    }

    private JButton getSendingPriceButton() {
        if (sendingPriceButton == null) {
            sendingPriceButton = new JButton();
            sendingPriceButton.setPreferredSize(new Dimension(284, 20));
            sendingPriceButton.setBorderPainted(false);
            sendingPriceButton.setContentAreaFilled(false);
            sendingPriceButton.setFocusPainted(false);
            sendingPriceButton.setHorizontalAlignment(2);
            sendingPriceButton.setText("Frais de port");
        }
        return sendingPriceButton;
    }

    private JButton getTaxPriceButton() {
        if (taxPriceButton == null) {
            taxPriceButton = new JButton();
            taxPriceButton.setPreferredSize(new Dimension(284, 20));
            taxPriceButton.setBorderPainted(false);
            taxPriceButton.setContentAreaFilled(false);
            taxPriceButton.setFocusPainted(false);
            taxPriceButton.setHorizontalAlignment(2);
            taxPriceButton.setText("Total TVA");
        }
        return taxPriceButton;
    }

    private JButton getNetPriceButton() {
        if (netPriceButton == null) {
            netPriceButton = new JButton();
            netPriceButton.setPreferredSize(new Dimension(284, 20));
            netPriceButton.setBorderPainted(false);
            netPriceButton.setContentAreaFilled(false);
            netPriceButton.setFocusPainted(false);
            netPriceButton.setHorizontalAlignment(2);
            netPriceButton.setText("Total TTC");
        }
        return netPriceButton;
    }

    private JCheckBox getPartPaymentCheckBox() {
        if (partPaymentCheckBox == null) {
            partPaymentCheckBox = new JCheckBox();
            partPaymentCheckBox.setPreferredSize(new Dimension(284, 20));
            partPaymentCheckBox.setFocusPainted(false);
            partPaymentCheckBox.setText("Pay\351");
            partPaymentCheckBox.setToolTipText("");
        }
        return partPaymentCheckBox;
    }

    private JCheckBox getDueCheckBox() {
        if (dueCheckBox == null) {
            dueCheckBox = new JCheckBox();
            dueCheckBox.setPreferredSize(new Dimension(284, 20));
            dueCheckBox.setFocusPainted(false);
            dueCheckBox.setText("Reste du");
        }
        return dueCheckBox;
    }

    public JButton getGrossPrice() {
        return getGrossPriceButton();
    }

    public JButton getSendingPrice() {
        return getSendingPriceButton();
    }

    public JButton getTaxPrice() {
        return getTaxPriceButton();
    }

    public JButton getNetPrice() {
        return getNetPriceButton();
    }

    public JCheckBox getPartPayment() {
        return getPartPaymentCheckBox();
    }

    public JCheckBox getDue() {
        return getDueCheckBox();
    }
    private JButton grossPriceButton;
    private JButton sendingPriceButton;
    private JButton taxPriceButton;
    private JButton netPriceButton;
    private JCheckBox partPaymentCheckBox;
    private JCheckBox dueCheckBox;
}
